﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using YW.Common;
using LTP.Accounts.Bus;
namespace YW.Web.HYXT.yw_hyyeb
{
    public partial class Add : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSave_Click(object sender, EventArgs e)
        {

            string strErr = "";
            if (this.txtEMPI.Text.Trim().Length == 0)
            {
                strErr += "EMPI不能为空！\\n";
            }
            if (!PageValidate.IsDecimal(txtxyye.Text))
            {
                strErr += "现有余额格式错误！\\n";
            }
            if (!PageValidate.IsDecimal(txtxyjf.Text))
            {
                strErr += "现有积分格式错误！\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string EMPI = this.txtEMPI.Text;
            decimal xyye = decimal.Parse(this.txtxyye.Text);
            decimal xyjf = decimal.Parse(this.txtxyjf.Text);

            YW.Model.HYXT.yw_hyyeb model = new YW.Model.HYXT.yw_hyyeb();
            model.EMPI = EMPI;
            model.xyye = xyye;
            model.xyjf = xyjf;

            YW.BLL.HYXT.yw_hyyeb bll = new YW.BLL.HYXT.yw_hyyeb();
            bll.Add(model);
            YW.Common.MessageBox.ShowAndRedirect(this, "保存成功！", "add.aspx");

        }


        public void btnCancle_Click(object sender, EventArgs e)
        {
            Response.Redirect("list.aspx");
        }
    }
}
